var ns, app;
app = new Vue({
    el: '#app',
    data: {
        ID: 0,
        showdetail:false,
        form:{},
        showmore:false,
        moreContent:'',
        moreName:'',
     
    },
    methods: {
        get_data: function () {
            var that = this;
            var options = {};
            options.ID = that.ID;
            options.action = "getuserstaffoutcontract";
            ns.post(options, function (succeed, data, err) {
                if (succeed) {
                    if(data.status){
                        that.form = data.ContractInfo;
                    }else{
                        api.toast({
                            msg: '接口错误',
                            duration: 2000,
                            location: 'bottom'
                        });
                    }
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });

                }
            }, {
                toast: true
            });
        },
       
        //合同审批-展开详细信息
        open_all:function(){
            var that=this;
            that.showdetail=true;
        },
        //合同审批-关闭详细信息，展示关键信息
        close_all:function(){
            var that=this;
            that.showdetail=false;
        },
         //外包单位详情
         othercomputer_detail:function(id){
            var that=this;
            ns.openWin('othercomputer_detail', '外包单位详情', {
                ID: id,
            });
        },
        do_viewimages: function (activeIndex) {
            var that = this;
            var imageUrls = [];
            for (var i = 0; i < that.form.Picture.length; i++) {
                imageUrls.push(that.form.Picture[i].ImgPath);
            }
            var imageBrowser = api.require('imageBrowser');
            imageBrowser.openImages({
                showList: false,
                activeIndex: activeIndex,
                imageUrls: imageUrls
            });
        },
        set_value:function(value){
            if(value&&value.length>30){
                value=value.substring(0,30)+'...';
            }
            return value;
        },
        open_more:function(item){
            var that=this;
            that.showmore=true;
            that.moreContent=item.AcceptCont;
            that.moreName=item.AcceptName;
        },
       

    }
});
apiready = function () {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.ID = api.pageParam.ID;
    app.get_data();
};
